<?php

include_once('baseModeldto.php');

include_once('customerdto.php');
include_once('orderStatusdto.php');
include_once('orderInfodto.php');

include_once($_SERVER['DOCUMENT_ROOT'] . '/smartrfid/model/customer.php');
include_once($_SERVER['DOCUMENT_ROOT'] . '/smartrfid/model/orderStatus.php');
include_once($_SERVER['DOCUMENT_ROOT'] . '/smartrfid/model/orderInfo.php');


class Orderdto extends BaseModeldto {
  public $id;
  public $identifier;
  public $customer;
  public $status;
  public $info;
  
  function resolveRelations() {
    $customer = new Customer();;
    $customer->load($this->getModel()->customer_id);
    $this->customer = new Customerdto($customer);
    
    $status = new OrderStatus();
    $status->loadByOrderId($this->id);
    $this->status = new OrderStatusdto($status);
    
    $info = new OrderInfo();
    $info->loadByOrderId($this->id);
    $this->info = new OrderInfodto($info);
    
    
  }
}

?>